package paa.simulator.grafo;

import java.io.Serializable;


public class PessoaVertex implements Serializable {

	private static final long serialVersionUID = 1L;
	
	private final int id;
	private boolean buy;
	private int influence;

	public PessoaVertex(int id) {
		this.id = id;
		this.buy = false;
		this.influence = 0;
	}

	public int getPessoa() {
		return id;
	}
	
	public void setAsBuying() {
		this.buy = true;
	}
	
	public boolean isBuying() {
		return buy;
	}

	public int incInfluence() {
		return ++influence;
	}
	
	public int getInfluence() {
		return influence;
	}
	
	@Override
	public int hashCode() {
		return id;
	}
	
	@Override
	public boolean equals(Object obj) {
		if (obj instanceof PessoaVertex) {
			PessoaVertex opv = (PessoaVertex) obj;
			return opv.id == id;
		}
		return false;
	}
	
	@Override
	public String toString() {
		return id + "";
	}
}
